package com.corejava.source;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class CellVender {
	private String cellVenderName;
	private String cellModel;
	public static Properties cellInfoPro = new Properties();

	public String getCellVenderName() {
		return cellVenderName;
	}

	public void setCellVenderName(String cellVenderName) {
		this.cellVenderName = cellVenderName;
	}

	public String getCellModel() {
		return cellModel;
	}

	public void setCellModel(String cellModel) {
		this.cellModel = cellModel;
	}

	public CellVender(String cellVenderName, String cellModel) {
		super();
		this.cellVenderName = cellVenderName;
		this.cellModel = cellModel;
		try {
			cellInfoPro.load(new FileInputStream("cellinfo.properties"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public CellBox getCellBox(){
		String[] cellInfo = cellInfoPro.getProperty(
				cellVenderName + "@" + cellModel).split("#");
		CellBox cellBox = new CellBox(cellInfo[0], cellInfo[1], cellInfo[2],
				Integer.parseInt(cellInfo[3]), Integer.parseInt(cellInfo[4]),
				cellInfo[5], cellInfo[6], cellVenderName, cellModel);
		return cellBox;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return super.toString();
	}

}
